## utils.py
import argparse

def parse_command_line_args():
    """
    Parses command line arguments.

    Returns:
        dict: A dictionary containing the parsed command line arguments.
    """
    parser = argparse.ArgumentParser(description="Process command line arguments for the database pinyin converter.")
    parser.add_argument("--host",type=str,required=True,help="The host of the database")
    parser.add_argument("--user",type=str,required=True,help="The user of the database")
    parser.add_argument("--password",type=str,required=True,help="The password of the database")
    parser.add_argument("--database",type=str,required=True,help="The database name")
    parser.add_argument("--port",type=int,required=True,help="The port of the database")
    parser.add_argument('--table_name', type=str, required=True, help='The name of the database table.')
    parser.add_argument('--field_name', type=str, required=True, help='The name of the field in the table to convert.')
    
    args = parser.parse_args()
    
    return {
        'table_name': args.table_name,
        'field_name': args.field_name,
        'host': args.host,
        'user': args.user,
        'password': args.password,
        'database': args.database,
        'port': args.port
    }
